Dart.Ftp Namespace > Ftp Class > Delete Method : Delete(List<ListEntry>) Method |
Public Overloads Function Delete( _ ByVal listing As List(Of ListEntry) _ ) As List(Of Response)
Dim instance As Ftp Dim listing As List(Of ListEntry) Dim value As List(Of Response) value = instance.Delete(listing)
public List<Response> Delete( List<ListEntry> listing )
public: List<Response^>^ Delete( List<ListEntry^>^ listing )
Exception | Description |
---|---|
FtpProtocolException | At least one command did not succeed. Details are included in the exception thrown. |
Any specified directories that are not empty (after the specified files are removed) will not be deleted by the server.
Use DeleteDirectory for deleting a directory tree.
First all files, then all directories are removed, starting at the end of the list.
private void deleteFiles() { //Delete a list of files (in this case, the txt files). ftp1.Delete(ftp1.ListDirectoryTree("MyTextFiles", "*.txt", false)); //Delete a specific file. ftp1.Delete("MyTextFiles/test.dat"); //Delete the directory, even when it is not empty. ftp1.DeleteDirectory("MyTextFiles"); }
Private Sub deleteFiles() 'Delete a list of files (in this case, the txt files). ftp1.Delete(ftp1.ListDirectoryTree("MyTextFiles", "*.txt", False)) 'Delete a specific file. ftp1.Delete("MyTextFiles/test.dat") 'Delete the directory, even when it is not empty. ftp1.DeleteDirectory("MyTextFiles") End Sub